<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of VideoServerId
 *
 * @author ZangGuoPing
 */
class VideoServerId extends CActiveRecord {

    //put your code here
    public function rules() {
        return array(
            array('server_id,video_id,server_type', 'required')
        );
    }

    /**
     * Returns the static model of the specified AR class.
     * @return CActiveRecord the static model class
     */
    public static function model($className=__CLASS__) {
        return parent::model($className);
    }

    /**
     * @return string the associated database table name
     */
    public function tableName() {
        return '{{video_servers}}';
    }
    public function relations()
    {
        return array(
            'videoId' => array(self::BELONGS_TO, 'video', 'video_id'),
            'server' => array(self::BELONGS_TO, 'server', 'server_id')
        );
    }
    public function attributeLabels() {
        return array(
            'server_id' => Yii::t('default', '服务器编号'),
            'video_id' => Yii::t('default', '服务器所属视频'),
            'server_type' => Yii::t('default', '服务器类型'),
        );
    }

}